<?php include 'header.php' ?>

<div class="container">

    <div class="row">

        <div class="span4 offset4 well">


            <?php
            echo '<div class="controls">
		   <span style="color:red; margin-left:12px;">' . validation_errors('&times;') . '</span>
		   </div>';
            ?>


            <?php
            echo form_fieldset('Register');
            if (isset($error) && $error):
                ?>
                <div class="alert alert-error">
                    <a class="close" data-dismiss="alert" href="#">×</a>Incorrect Username or Password!

                </div>
            <?php endif; ?>

            <?php
            echo form_open('login/register');

            echo form_label('First Name', 'fname');
            echo form_input('fname', '', 'class="span4" id="fname" placeholder="Your first name..."');

            echo form_label('Last Name', 'lname');
            echo form_input('lname', '', 'class="span4" id="lname" placeholder="Your last name..."');

            echo form_label('User Name', 'username');
            echo form_input('username', '', 'class="span4" id="username" placeholder="Your user name..."');

            echo form_label('Email', 'email');
            echo form_input(array('name' => 'email', 'value' => '', 'type' => 'email', 'class' => 'span4', 'id' => 'email', 'placeholder' => 'Email address...'));

            echo form_label('Password', 'password');
            echo form_password('password', '', 'class="span4" id="password" placeholder="Password..."');

            echo form_label('Confirm Password', 'con_password');
            echo form_password('con_password', '', 'class="span4" id="con_password" placeholder="Confirm Password..."');

            echo form_label('User Level', 'user_level');
            ?>
            <select name="user_level" id="user_level">
                <?php
                if ($user_level) {
                    foreach ($user_level as $level) {
                        echo '<option value="' . $level->role_id . '">' . $level->role_name . '</option>';
                    }
                }
                ?>
            </select>
            <?php
            echo form_label('Gender', 'gender');
            echo form_dropdown('gender', array('Male' => 'Male', 'Female' => 'Female',), 'Male');

            echo form_label('Date Of Birth', 'dob');
            echo form_input('dob', '', 'class="span4" id="dob" placeholder="Your date of birth..."');

            echo form_label('Nationality', 'nationality');
            echo form_input('nationality', '', 'class="span4" id="nationality" placeholder="Your nationality..."');

            echo form_label('Upload Photo', 'user_photo');
            echo "<input type='file' name='user_photo' value='Upload...' />";

            echo form_submit('submit_register', 'Register', 'class="btn btn-info btn-block"');
            echo form_close();
            ?>
            <span>Already have an account?</span>
            <?php
            echo anchor('login/', 'Login');
            echo form_fieldset_close();
            ?>
        </div>
    </div>

</div>

<?php include 'footer.php' ?>